{%extends "base.html"%}

{%block content%}
    {%block content_top%}{%endblock%}
    <div class = "top paginator">{%include "i_paginator.html"%}</div>
    <hr>
    <div>
    {%for p in products%}
        <span class = "span-3 product">
            <div class = "description">
                <a href = "/products/{{p.pk}}">
                    <img src = "{{STATIC_URL}}images/empty.jpeg" alt = "empty">
                    <div>{{p.name}}</div>
                </a>
                <p>Cost: {{p.cost}} <b>&euro;</b></p>
            </div>
            {%if user.is_authenticated%}
                <form action = "/cart/add/" method = "post">
                    {%csrf_token%}
                    <input style = "width: 50px;" type = "text" name = "count" value = "1">
                    <button>Add</button>
                    <input type = "hidden" name = "product_id" value = "{{p.pk}}">
                </form>
            {%endif%}
        </span>
    {%endfor%}
    </div>
    <div class = "bottom paginator">{%include "i_paginator.html"%}</div>
    {%block content_bottom%}{%endblock%}
{%endblock%}
